package 强化训练;

import java.util.Scanner;

public class day38蘑菇阵 {
    //状态转移方程：p(i,j) = p(i-1,j) * (i == m ? 1 : 0.5) + p(i,j-1) * (j == n ? 1 : 0.5)
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()){
            int m = sc.nextInt();
            int n = sc.nextInt();
            int[][] map = new int[m+1][n+1];

            int k = sc.nextInt();
            while (0 != k ){
                int x = sc.nextInt();
                int y = sc.nextInt();
                map[x][y] = 1;
            }
            double res =  sover(map,m,n);
            System.out.printf("%.2f\n",res);
        }
    }

    private static double sover(int[][] map, int m, int n) {
        double[][] dp = new double[m+1][n+1];
        dp[1][1] = 1;
        for (int i = 1; i < m; i++) {
            for (int j = 1; j < n; j++) {
                if (!(i ==1  && j == 1)){
                    dp[i][j] =  dp[i-1][j] * (i == m ? 1 : 0.5) + dp[i][j-1] * (j == n ? 1 : 0.5);
                }

                if (map[i][j] == 1){
                    dp[i][j] = 0;
                }
            }
        }
        return dp[m][n];
    }
}
